package com.hw.one.collect.xinxiang.job;

import com.hw.one.collect.config.ConditionConfig;
import com.hw.one.collect.xinxiang.client.XxClient;
import com.hw.one.collect.xinxiang.data.XinxiangPushService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * Copyright 2017 汉威.智慧环保事业部.
 * Created by 李亚坤 on 2017/05/17 09:33.
 */
@Component
public class XinxiangPushJob {

    @Resource
    private XinxiangPushService xinxiangPushService;
    private Logger log = Logger.getLogger(this.getClass());
    public void start() {
        String areaId = ConditionConfig.get("AREAID", "xinxiang");
        log.info("areaId = " + areaId);
        List<byte[]> resultList = xinxiangPushService.findFiveMinDataByAreaId(areaId);
        XxClient xxClient = new XxClient();
        log.info("xinxiang push size :" + resultList.size());
        xxClient.send(resultList);

    }
}
